<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<!DOCTYPE html>
<html>
<head>
<%@ include file="../include/header.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btnCheck").click(function(){
				var userid = $("#userid").val();
				if(userid.length == 0){
				alert("아이디를 입력하세요");
				$("#userid").focus();
				return;
				}
				// Action 클래스의 setter 와 일치해야한다
				var param = "userid="+userid;
				$.ajax({
					type:"post",
					url:"${path}/member/useridCheck.do",
					data:param,
					success:function(msg){
						$("#result").html(msg);						
					}
				});
			});
		});
		function idUse(userid){
			$("#userid",opener.document).val(userid); //  큰따옴표가 없으면 객체처리됨
			$("#idcheck",opener.document).val("Y");
			window.close();
		}
	</script>
</head>
<body>
	<h3>아이디 중복 확인</h3>
	<hr/>
	<form name="form1" id="form1" method="post" >
		아이디를 입력하세요<br/>
		<input type="text" name="userid" id="userid" value="${userid }"/>
		<input type="button" value="확인" id="btnCheck"/>
	</form>
	<div id="result">

	</div>
</body>
</html>